package cms.api.framework.search;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.Map;

/**
 * 保存检索参数
 *
 * @author kuangjz
 *
 */

@Data
@NoArgsConstructor
@ToString
@EqualsAndHashCode
public class QueryParams {
    String index;
    String type;
    String rtnFields;
    String sortField;
    String highlightField;
    Map<String,Object> conditions;

    public QueryParams index(String index){
        this.index = index;
        return this;
    }
    public QueryParams type(String type){
        this.type=type;
        return this;
    }
    public QueryParams rtnFields(String rtnFields){
        this.rtnFields=rtnFields;
        return this;
    }
    public QueryParams sortField(String sortField){
        this.sortField=sortField;
        return this;
    }
    public QueryParams highlightField(String highlightField){
        this.highlightField=highlightField;
        return this;
    }
    public QueryParams conditions(Map<String,Object> conditions){
        this.conditions =conditions;
        return this;
    }
}
